package com.zero.business.order.feign;

import com.zero.domain.Bicycle;
import com.zero.business.order.feign.sentinel.OrderBicycleFeignSentinel;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestParam;


/*
*   订单模块 远程调用 单车模块
* */

// value：远程调用的服务名称     fallback：降级方法所在类 的类对象
@FeignClient(value = "zero-business-bicycle", fallback = OrderBicycleFeignSentinel.class)
public interface OrderBicycleFeign {

    String baseUrl = "/bicycle/";

    /*
     *   远程调用 单车模块中的 selectByPrimaryKey 接口，根据 bicycleId 获取会员数据
     * */
    @GetMapping(baseUrl + "selectByPrimaryKey")
    public Bicycle selectByPrimaryKey(@RequestParam("bicycleId") Integer bicycleId);

    /*
    *   远程调用 单车模块中的 updateByPrimaryKeySelective 接口，更新车辆状态
    * */
    @PutMapping(baseUrl + "updateByPrimaryKeySelective")
    public void updateByPrimaryKeySelective(@RequestParam("bicycleId") Integer bicycleId,@RequestParam("status") String status,@RequestParam("remark") String remark);

}
